package com.crime.crimemonitorclient;

import android.content.Context;
import android.webkit.JavascriptInterface;
import android.widget.Toast;

public class CrimeSummaryGraphWebAppInterface {
    private final OnCrimeItemSelectedListener mOnCrimeItemSelectedListener;

    /** Instantiate the interface and set the context */
    CrimeSummaryGraphWebAppInterface(OnCrimeItemSelectedListener onCrimeItemSelectedListener) {
        this.mOnCrimeItemSelectedListener = onCrimeItemSelectedListener;
    }

    /** Show a toast from the web page */
    @JavascriptInterface
    public void onCrimeItemIndexSelected(int crimeItemIndex) {
        this.mOnCrimeItemSelectedListener.onCrimeItemSelected(crimeItemIndex);
    }
}